]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
StTextureCache: fix load_sliced_image with different sizes
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 20 Dec 2011 18:14:12 +0000 (19:14 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 20 Dec 2011 18:25:43 +0000 (19:25 +0100)
grid_width and grid_height were inverted, which caused a crash
in GdkPixbuf code. This was never noticed because the animation
in the panel is a square.

https://bugzilla.gnome.org/show_bug.cgi?id=666606

src/st/st-texture-cache.c

index 377f3b9d5122ede5e393ee10639cf2adeb40b40e..011512cc38a81ea4ddb20d5c03c3923abec362b4 100644 (file)
@@ -1226,9 +1226,9 @@ load_sliced_image (GSimpleAsyncResult *result,
 
   width = gdk_pixbuf_get_width (pix);
   height = gdk_pixbuf_get_height (pix);
-  for (y = 0; y < height; y += data->grid_width)
+  for (y = 0; y < height; y += data->grid_height)
     {
-      for (x = 0; x < width; x += data->grid_height)
+      for (x = 0; x < width; x += data->grid_width)
         {
           GdkPixbuf *pixbuf = gdk_pixbuf_new_subpixbuf (pix, x, y, data->grid_width, data->grid_height);
           g_assert (pixbuf != NULL);